package cn.xopencode.recordservice.convert.roomin;

import cn.xopencode.common.framework.vo.PageResult;
import cn.xopencode.recordservice.dal.mysql.dataobject.roomin.RoomInRecordDO;
import cn.xopencode.recordservice.dal.mysql.dataobject.roomin.RoomInRecordEmpRelDO;
import cn.xopencode.recordservice.rpc.roomin.dto.*;
import cn.xopencode.recordservice.rpc.roomin.vo.RoomInRecordEmpRelVO;
import cn.xopencode.recordservice.rpc.roomin.vo.RoomInRecordPageVO;
import cn.xopencode.recordservice.rpc.roomin.vo.RoomInRecordUpdateVO;
import cn.xopencode.recordservice.service.roomin.bo.AdminRoomInRecordBO;
import cn.xopencode.recordservice.service.roomin.bo.RoomInRecordCreateBO;
import cn.xopencode.recordservice.service.roomin.bo.RoomInRecordPageBO;
import cn.xopencode.recordservice.service.roomin.bo.RoomInRecordUpdateBO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface RoomInRecordConvert {

    RoomInRecordConvert INSTANCE = Mappers.getMapper(RoomInRecordConvert.class);

    @Mapping(source = "records", target = "list")
    PageResult<RoomInRecordPageVO> convert(IPage<RoomInRecordDO> recordDOIPage);

    @Mapping(source = "records", target = "list")
    PageResult<AdminRoomInRecordVO> convert1(IPage<RoomInRecordDO> recordDOIPage);

    List<RoomInRecordEmpRelVO> convert(List<RoomInRecordEmpRelDO> doList);

    RoomInRecordPageBO convert(RoomInRecordPageDTO pageDTO);

    RoomInRecordUpdateVO convert(RoomInRecordDO recordDO);

    RoomInRecordCreateBO convert(RoomInRecordCreateDTO createDTO);

    RoomInRecordDO convert(RoomInRecordCreateBO createBO);

    RoomInRecordUpdateBO convert(RoomInRecordUpdateDTO createBO);

    RoomInRecordDO convert(RoomInRecordUpdateBO createBO);

    AdminRoomInRecordBO convert(AdminRoomInRecordDTO pageDTO);
}
